package com.web.constant;

/**
 * @Author: wws
 * @Date: 2021/1/12 17:08
 * describe:下行数据包常量
 */
public class DataPackageConstants {

    public static byte[] DEFAULT_GROUP_ADDR = { (byte) 0xEE,(byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
    public static byte[] DEFAULT_GROUP_APPKEY = {(byte) 0x00, (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF};
    public static byte[] DEFAULT_GROUP_APPSKEY = {(byte) 0x00, (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF};
    public static byte[] DEFAULT_GROUP_NWKSKEY = {(byte) 0x00, (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF};

    /**
     * 用于定义与网关桥通信的数据类型，（帧头）
     */
    public final static byte REGISTER = 0x01;//注册
    public final static byte DELETE = 0x02;//删除
    public final static byte GATEWAY_REGISTERED_OR_DELETE = 0x01;//1、网关注册与删除
    public final static byte DEVICE_REGISTERED_OR_DELETE = 0x02;//2、设备入网与删除
    public final static byte DEVICE_JOIN = 0x03;//3、网关桥上传设备与网关绑定数据
    public final static byte DEVICE_DATA_UP = 0x04;//4、终端数据上行
    public final static byte DATA_DOWNLINK = 0x05;//5、数据下行
    public final static byte DEVICE_GROUP = 0x06;//6、设备分组和组操作命令
    public final static byte GET_GATEWAY_HEARTBEAT = 0x07;//7、获取网关心跳
    public final static byte GET_DEVICE_RXPK = 0x08;//8、读取无线无线参数
    public final static byte GET_GATEWAY_BRIDGE_HEARTBEAT = 0x09;//9、网关桥与WEBS心跳

    /**
     * 用于定义与网关桥通信的上下行方向
     */
    public final static byte DOWN_LINK = 0x00;//下行
    public final static byte UP_LINK = 0x01;//上行

    /**
     * 用于定义数据下行时，使用哪种频点
     */
    public final static byte DYNAMIC_FREQ = 0x01;//动态频点
    public final static byte STATIC_FREQ = 0x02;//静态频点

    /**
     * 生成NWKSKEY或APPSKEY的类型
     */
    public final static byte NWKSKEY_TYPE = 0x01;
    public final static byte APPSKEY_TYPE = 0x02;

    /**
     * 下行数据帧中应包含的数据
     */
    public final static byte[] NET_ID = new byte[]{0x00, 0x00, 0x00};
    public final static byte JOIN_ACCEPT_MHDR = 0x20;
    public final static byte DEVICE_CONTROL_MHDR = 0x60;
    public final static byte FCTRL = 0x60; //FCtrl

    public final static byte FPORT = 0x05;
    public final static byte MULTI_FPORT = 0x06;


    public final static byte DLSETTINGS = 0x00;//DLSettings
    public final static byte RXDELAY = 0x01;//RxDelay

    /**
     * 用于定义智能开关数据帧的操作类型，（帧头）
     */
    public final static byte SWITCH_LIGHT_STATUS = 0x01;// 设置/获取开关状态
    public final static byte SWITCH_LIGHT_STATUS_RESPONSE = (byte) 0x81;//设置/获取开关状态响应
    public final static byte SWITCH_CONTROL_STATUS = 0x02;// 设置/获取手动、远程、定时开关控制
    public final static byte SWITCH_CONTROL_STATUS_RESPONSE = (byte) 0x82;// 设置/获取手动、远程、定时开关控制响应
    public final static byte SWITCH_SCHEDULE = 0x03;// 设置/获取定时开关时间表
    public final static byte SWITCH_SCHEDULE_RESPONSE = (byte) 0x83;// 设置/获取定时开关时间表响应
    public final static byte SWITCH_DIMMING_LEVEL = 0x04;// 设置/获取调光等级
    public final static byte SWITCH_DIMMING_LEVEL_RESPONSE = (byte) 0x84;// 设置/获取调光等级响应
    public final static byte SWITCH_DEVICE_ATTRIBUTES = 0x05;// 获取开关的温度、湿度、露点、电源/电量、设备状态
    public final static byte SWITCH_DEVICE_ATTRIBUTES_RESPONSE = (byte) 0x85;// 获取开关的温度、湿度、露点、电源/电量、设备状态响应
    public final static byte SWITCH_REPORTING_PERIOD = 0x06;// 设置/获取上报周期
    public final static byte SWITCH_REPORTING_PERIOD_RESPONSE = (byte) 0x86;// 设置/获取上报周期响应
    public final static byte SWITCH_OPERATING_HOURS = 0x07;// 获取开关工作时间;
    public final static byte SWITCH_OPERATING_HOURS_RESPONSE = (byte) 0x87;// 获取开关工作时间响应
    public final static byte SWITCH_APPKEY = 0x08;//  设置/获取开关的APPKEY
    public final static byte SWITCH_APPKEY_RESPONSE = (byte) 0x88;// 设置/获取开关的APPKEY响应
    public final static byte SWITCH_GET_INFO = 0x09;//  获取设备类型、初始化上行通道、版本号
    public final static byte SWITCH_GET_INFO_RESPONSE = (byte) 0x89;// 获取设备类型、初始化上行通道、版本号响应

    public final static byte SWITCH_SET_GROUP = (byte) 0x20;// 获取设备类型、初始化上行通道、版本号响应
    public final static byte SWITCH_DELETE_GROUP = (byte) 0x22;// 删除一个终端所有分组
    public final static byte SWITCH_DELETE_REBOOT = (byte) 0x23;//终端重启
    public final static byte SWITCH_DELETE_RESET = (byte) 0x24;// 删除一个终端所有分组
    public final static byte SWITCH_DELETE_TIME = (byte) 0x25;// 设置/获取设备时间

    public final static byte GROUP_ADD_SWITCH = (byte) 0x30;// 添加多个终端到一个分组
    public final static byte GROUP_SWITCH_LIGHT_STATUS = (byte) 0x40;//组设置开关状态
    public final static byte GROUP_SWITCH_CONTROL_STATUS_STATUS = 0x41;// 组设置手动、远程、定时开关控制
    public final static byte GROUP_SWITCH_SCHEDULE = (byte) 0x42;// 组设置定时开关时间表
    public final static byte GROUP_SWITCH_DIMMING_LEVEL = 0x43;// 组设置调光等级
    public final static byte GROUP_SWITCH_REPORTING_PERIOD = 0x44;// 组设置上报周期
    public final static byte GROUP_SWITCH_APPKEY = 0x45;// 组设置APPKEY
    public final static byte GROUP_SWITCH_REBOOT = 0x46;// 组重启
    public final static byte GROUP_SWITCH_RESET = 0x47;// 组恢复默认设置
    public final static byte GROUP_SWITCH_TIME = 0x48;// 组设置设备时间

    /**
     * 用于定义智能开关数据帧的长度（长度）
     */
    public final static byte SWITCH_LIGHT_STATUS_SET = 0x03;// 设置开关状态
    public final static byte SWITCH_LIGHT_STATUS_GET = 0x01;// 获取开关状态

    public final static byte SWITCH_CONTROL_STATUS_SET = 0x07;// 设置开手动、远程、定时开关控制
    public final static byte SWITCH_CONTROL_STATUS_GET = 0x02;// 获取开手动、远程、定时开关控制

    public final static byte SWITCH_SCHEDULE_SET = 0x03;//设置定时开关时间表
    public final static byte SWITCH_SCHEDULE_GET = 0x02;//获取定时开关时间表

    public final static byte SWITCH_DIMMING_LEVEL_SET = 0x03;// 设置/获取调光等级
    public final static byte SWITCH_DIMMING_LEVEL_GET = 0x01;// 设置/获取调光等级

    public final static byte SWITCH_DEVICE_ATTRIBUTES_GET = 0x01;// 获取开关的温度、湿度、露点、电源/电量、设备状态

    public final static byte SWITCH_REPORTING_PERIOD_SET = 0x03;// 设置上报周期
    public final static byte SWITCH_REPORTING_PERIOD_GET = 0x01;// 获取上报周期

    public final static byte OPERATING_HOURS_GET = 0x01;// 获取开关工作时间;

    public final static byte SWITCH_APPKEY_SET = 0x11;//  设置/获取开关的APPKEY
    public final static byte SWITCH_APPKEY_GET = 0x01;//  设置/获取开关的APPKEY

    public final static byte SWITCH_GET_INFO_GET = 0x01;//  获取设备类型、初始化上行通道、版本号


    /**
     * 定义对智能开关的操作类型
     */
    public final static byte SWITCH_OPERATING_SET = 0x00;// 设置
    public final static byte SWITCH_OPERATING_GET = 0x01;//获取
    public final static byte SWITCH_OPERATING_REPORT = 0x02;//上报

    /**
     * 用于生成帧计数器FCnt
     */
    private final static int FCNT_MAX = 65536;//FCNT_MAX FCNT最大值

}
